package com.bzgwl.mybatis_plus.rabbitMq;

import com.bzgwl.mybatis_plus.webSocket.WebSocketServer;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DirectListerner {

    @Autowired
    private WebSocketServer webSocketServer;

    @RabbitListener(queues="str")    //str
    public void sendMessages(String str) {
        try {
            webSocketServer.sendInfo(str);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
